//Customer.java
// Represents a customer
import java.util.ArrayList;

public class Customer {
	private String FirstName; // Customer FirstName
	private String LastName; // Customer LastName
	private String cpr; // Customer CPR-nummer
	private String CustomerType; // CustomerType Private/business
	private String City; // Customer address
	private int Zip; // Customer Zip
	private int ClientNumber; // Customer ClientNumber
	private int pin; // Customer pin
	private ArrayList<Account> accountList; // ArrayList of accounts for each customer

	// Customer constructor initializes attributes
	public Customer(String theFirstName, String theLastName, String theCPR,
			String theCustomerType, String theCity, int theZip,
			int theClientNumber, int thePIN) {
		FirstName = theFirstName;
		LastName = theLastName;
		cpr = theCPR;
		CustomerType = theCustomerType;
		City = theCity;
		Zip = theZip;
		pin = thePIN;
		ClientNumber = theClientNumber;
		this.accountList = new ArrayList<Account>();
	} // end constructor Customer

	// method for creating new accounts
	public void createAccount(int accountNumber, double AvailableBalance,
			double TotalBalance, String AccountType) {
		accountList.add(new Account(accountNumber, AvailableBalance,
				TotalBalance, AccountType));
	} // end method createAccount

	// method for getting ArrayList of Accounts and returns accountList
	public ArrayList<Account> getAccountList() {
		return accountList;
	} // end method

	// method for validating PIN using a boolean to return true/false
	public boolean validatePIN(int userPIN) {
		if (userPIN == pin)
			return true;
		else
			return false;
	} // end method

	// returns clientNumber
	public int getClientNumber() {
		return ClientNumber;
	} // end method getClientNumber

	// returns FirstName
	public String getFirstName() {
		return FirstName;
	}// end method getFirstName

	// returns list of customers in the following order
	public String toString() {
		String viewCustomers;
		viewCustomers = FirstName + " " + LastName + ", " + cpr + ", "
				+ CustomerType + ", " + City + ", " + Zip + ", " + ClientNumber
				+ ", " + pin;
		return viewCustomers;
	}// end method viewCustomers
} // end class Customer

